<?php
/**
 * 加入我们
 */
namespace app\admin\model;
use app\common\model\MemberDonation as MemberDonationModel;
use app\common\model\Member as MemberModel;

class MemberDonation extends MemberDonationModel
{
    public static function getList($orderby,$limit,$page){
        $res = self::order($orderby)->paginate(['list_rows'=>$limit,'page'=>$page])->toArray();
        $data = [];

        foreach ($res['data'] as $k => $v){
            $member = MemberModel::getDetails($v['mid']);
            $v['username'] = $member ? $member['username'] : '';
            $data[$k] = $v;
        }
        $res['data'] = $data;
        return $res;
    }
}